import request from '@/plugin/axios'

// 发送文字邮件
export function sendEmail(data) {
    return request({
        url: '/chat/emailinfo/send',
        method: 'post',
        data
    })
}

// 发送富文本邮件
export function sendHtmlEmail(data) {
    return request({
        url: '/chat/emailinfo/sendHtml',
        method: 'post',
        data
    })
}

// 发送模板邮件
export function sendFreemarkerEmail(data) {
    return request({
        url: '/chat/emailinfo/sendFreemarker',
        method: 'post',
        data
    })
}

// 获取分页列表
export function getemailinfopage(params) {
    return request({
        url: '/chat/emailinfo/page',
        method: 'get',
        params: request.adornParams(params)
    })
}

// 获取列表
export function getemailinfolist(params) {
    return request({
        url: '/chat/emailinfo/list',
        method: 'get',
        params: request.adornParams(params)
    })
}

// 获取信息
export function getemailinfoinfo(id) {
    return request({
        url: '/chat/emailinfo/info/' + id,
        method: 'get',
        params: request.adornParams({})
    })
}

// 添加
export function addemailinfo(data) {
    return request({
        url: '/chat/emailinfo/save',
        method: 'post',
        data
    })
}

// 修改
export function updateemailinfo(data) {
    return request({
        url: '/chat/emailinfo/update',
        method: 'put',
        data
    })
}

// 批量删除
export function delBatchemailinfo(params) {
    return request({
        url: '/chat/emailinfo/delete',
        method: 'post',
        data: request.adornData(params, false)
    })
}

// 删除
export function delemailinfo(id) {
    return request({
        url: '/chat/emailinfo/delete/' + id,
        method: 'delete',
    })
}